/*
 * @lc app=leetcode.cn id=1 lang=javascript
 *
 * [1] 两数之和
 */


var lengthOfLongestSubstring = function(s) {
    let arr= s.split(' ')
    let arr2 = s.split(' ')
    let newArr = []
    let num = 0
    console.log(arr,'arr')
    arr.forEach((item)=>{
        newArr = []
        arr2.shift()
        console.log('-----------',arr2)
        for(let i = 0; i <arr2.length ; i++){
            console.log(arr2[i])
            if(newArr.findIndex(item3=>arr2[i] === item3) === -1){
              newArr.push(arr2[i])
              console.log(newArr)
            }else{
              break
            }
        }
        // console.log(newArr)
        num < newArr.length ? num = newArr.length : null
    })
    console.log(num)
  };
    lengthOfLongestSubstring('')
// @lc code=end

